StupidBeauty
Read times:664Posted at:Fri Jun 28 05:08:33 2013
- no title specified

转载通过AudioManager 设置调整系统各项音量(铃声 媒体等)

可使用AudioManager来让系统静音。

http://www.pocketdigi.com/20110717/398.html

亮点:

首先是步进的方法:
public void adjustStreamVolume (int streamType, int direction, int flags)

1

am.adjustStreamVolume (AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI ) ;

解释一下三个参数
第一个streamType是需要调整音量的类型,这里设的是媒体音量,可以是:
STREAM_ALARM 警报
STREAM_MUSIC 音乐回放即媒体音量
STREAM_NOTIFICATION 窗口顶部状态栏Notification,
STREAM_RING 铃声
STREAM_SYSTEM 系统

短裙诱惑

Your opinions
Your name:Email:Website url:Opinion content: